package com.stone.common.result;

import lombok.Getter;

/**
 * 自定义错误码
 *
 * @author <a href="https://github.com/liyupi">程序员鱼皮</a>
 * @from <a href="https://yupi.icu">编程导航知识星球</a>
 */
@Getter
public enum ErrorCode {
    SUCCESS(0, "ok"),
    PARAMS_ERROR(5000, "请求参数错误"),
    NOT_LOGIN_ERROR(5100, "未登录"),
    NO_AUTH_ERROR(5101, "无权限"),
    LOGIN_ERROR(5102, "登录失败"),
    NOT_FOUND_ERROR(5200, "请求数据不存在"),
    FORBIDDEN_ERROR(5201, "禁止访问"),
    SYSTEM_ERROR(5300, "系统内部异常"),
    OPERATION_ERROR(5400, "操作失败");

    /**
     * 状态码
     */
    private final int code;

    /**
     * 信息
     */
    private final String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

}
